package com.example.create_excel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
public class Debug {
    private final DataService dataService;
    private final DataMapper dataMapper;

    @Autowired
    public Debug(DataMapper dataMapper,DataService dataService) {
        this.dataService = dataService;
        this.dataMapper = dataMapper;
    }

    @GetMapping("/debug")
    public void debug() throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
        System.out.println(sdf.format(new Date()));
    }

    @GetMapping("/debug1")
    public List<Map<String, String>> debug1(){
        return dataService.getData_ywlj();
    }
}
